<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>编辑管理员信息</title>
<link rel="stylesheet" rev="stylesheet" href="<c:url value="/styles/ad/style.css"/>" type="text/css"/>
<script language="JavaScript" type="text/javascript" src="<c:url value="/scripts/jquery-1.4.4.min.js"/>"></script>
<script language="JavaScript" type="text/javascript">
var nameOk = true;
var telOk = true;
function saveAdminInfo(){
	var uname = jQuery.trim($("#uname").val());
	var newPwd = jQuery.trim($("#newPwd").val());
	if(uname == ""){
		alert("请输入登录名称");
		return false;
	}
	if(newPwd == ""){
		$("#flag").attr("value","0");
		return true;
	}else{
		var regu = "^[0-9a-zA-Z]{6,16}$";
		var re = new RegExp(regu);
		if(!re.test(newPwd)){
			alert("密码格式输入错误");
			return false;
		}else{
			var commitPwd = jQuery.trim($("#comitPwd").val());
			if(commitPwd == ""){
				alert("请确认新密码");
				return false;
			}else if(commitPwd != newPwd){
				alert("两次密码输入不相符");
				return false;
			}else{
				$("#flag").attr("value","1");
				return true;
			}
		}
	}
	
}
</script>
<style type="text/css">
<!--
.atten {font-size:12px;font-weight:normal;color:#F00;}
-->
</style>
</head>

<body class="ContentBody">
  <form action="editAdmin" method="post" name="form">
  <input type="hidden" value="" name="flag" id="flag"/>
  <input type="hidden" value="${user.get('ucode')}" name="ucodeVal"/>
<div class="MainDiv">
<table width="99%" border="0" cellpadding="0" cellspacing="0" class="CContent">
  <tr>
      <th class="tablestyle_title" >管理员信息编辑页面</th>
  </tr>
  <tr>
    <td class="CPanel">
		<table border="0" cellpadding="0" cellspacing="0" style="width:100%">
		<tr>
			<td align="left">
				<input type="submit" name="Submit" value="保存" class="button" onclick="return saveDpgl();"/>　			
				<input type="button" name="Submit2" value="返回" class="button" onclick="window.history.go(-1);"/>			</td>
		</tr>
			<TR>
			<TD width="100%">
				<fieldset style="height:100%;">
				<legend>修改管理员信息</legend>
					  <table border="0" cellpadding="2" cellspacing="1" style="width:100%">
					 
					  <tr>
					    <td nowrap align="right" width="15%">管理员编号:</td>
					    <td width="35%"><input name='ucode' class="text" style="width:154px" value="${user.get('ucode')}" disabled="disabled"/>
				        <span class="red">*</span></td>
					    <td width="16%" align="right" nowrap="nowrap">登录名称:</td>
					    <td width="34%"><input class="text" name='uname' style="width:154px" id="uname" value="${user.get('uname')}"/>
					    <span class="red">*</span>
					    </td>
					  </tr>
					  <tr>
					    <td nowrap align="right" width="15%">新密码:</td>
					    <td width="35%"><input name='newPwd' id="newPwd" class="text" style="width:154px" value=""/>
				        <span>(*需要修改时再填入)</span></td>
					    <td width="16%" align="right" nowrap="nowrap">确认新密码:</td>
					    <td width="34%"><input class="text" name='comitPwd' style="width:154px" id="comitPwd" value=""/>
					    <span>(*确认输入得新密码)</span>
					    </td>
					  </tr>
					  </table>
			  <br />
				</fieldset>			</TD>
		</TR>
		</TABLE>
	
	
	 </td>
  </tr>
		<TR>
			<TD colspan="2" align="center" height="50px">
			<input type="submit" name="Submit" value="保存" class="button" onclick="return saveAdminInfo();"/>　
			
			<input type="button" name="Submit2" value="返回" class="button" onclick="window.history.go(-1);"/></TD>
		</TR>
		</TABLE>
	 </td>
  </tr>
  
  
  
  </table>

</div>
</form>
</body>
</html>